package com.Policing.Polling;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import com.Policing.R;

import java.util.List;

/**
 * Created by Administrator on 2019/5/5.
 */

public class Content_Adapter extends ArrayAdapter {
    public Content_Adapter(Context context, int resource, List<Content_Bean> objects) {

        super(context, resource, objects);
    }
    @Override
    public View getView(int position, View convertView, ViewGroup parent) {

        final Content_Bean linkeMain = (Content_Bean)getItem(position);
        final View view = LayoutInflater.from(getContext()).inflate(R.layout.content_item, null);
        TextView project = (TextView) view.findViewById(R.id.project);
        ImageView Asset_img = (ImageView)view.findViewById(R.id.Asset_img);
        TextView methods = (TextView) view.findViewById(R.id.methods);
        TextView frequency = (TextView)view.findViewById(R.id.frequency);
        TextView result = (TextView)view.findViewById(R.id.result);
        TextView pointContentId = (TextView)view.findViewById(R.id.pointContentId);
        TextView standard = (TextView)view.findViewById(R.id.standard);
        TextView matters = (TextView)view.findViewById(R.id.matters);
        Asset_img.setImageBitmap(linkeMain.getAsset_img());
        methods.setText(linkeMain.getMethods());
        frequency.setText(linkeMain.getFrequency());
        result.setText(linkeMain.getResult());
        pointContentId.setText(linkeMain.getPointContentId());
        project.setText(linkeMain.getProject());
        standard.setText(linkeMain.getStandard());
        matters.setText(linkeMain.getMatters());
        return view;
    }


}
